import 'package:flutter/material.dart';
import 'demo/bottom_navigation_bar_demo.dart';
import 'demo/drawDemo.dart';
import 'demo/listview_demo.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: "demo",
      theme: ThemeData(
          highlightColor: Colors.transparent,
          splashColor: Colors.green,
          primarySwatch: Colors.blueGrey,
          primaryTextTheme: TextTheme(title: TextStyle(fontSize: 20.0))),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return DefaultTabController(
        length: 3,
        child: Scaffold(
          appBar: AppBar(
            title: Text("Demo"),
            actions: <Widget>[
              IconButton(
                icon: Icon(Icons.search),
                onPressed: () => debugPrint("search"),
              )
            ],
            bottom: TabBar(
              indicatorColor: Colors.amber,
              indicatorSize: TabBarIndicatorSize.label,
              tabs: <Widget>[
                Tab(
                  icon: Icon(Icons.local_florist),
                ),
                Tab(
                  icon: Icon(Icons.directions_bike),
                ),
                Tab(
                  icon: Icon(Icons.timer),
                )
              ],
            ),
          ),
          body: TabBarView(children: <Widget>[
            ListViewDemo(),
            Icon(
              Icons.directions_bike,
              color: Colors.black12,
              size: 128.0,
            ),
            Icon(
              Icons.timer,
              color: Colors.black12,
              size: 128.0,
            ),
          ]),
          drawer: drawDemo(),
          bottomNavigationBar: BottomNavigationBarDemo(),
        ));
  }
}
